package ru.incoremedia.gwttest.application.server.controller;

import com.google.gwt.rpcforms.server.annotation.FormController;
import com.google.gwt.rpcforms.server.annotation.ValueOf;
import com.google.gwt.rpcforms.server.controller.ProcessSubmitController;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import ru.incoremedia.gwttest.application.client.component.PostFormPanel;
import ru.incoremedia.gwttest.core.client.security.UserRole;
import ru.incoremedia.gwttest.core.server.security.Allow;


@FormController(PostFormPanel.POST_FORM_CONTROLLER)
@Allow(userRoles={UserRole.ROLE_ADMIN, UserRole.ROLE_USER})
public class PostFormController implements ProcessSubmitController<Boolean> {

    @ValueOf(PostFormPanel.TEXT_AREA)
    @NotNull
    @Size(min = 1, max = 65535, message="validator.incorrectStupidText")
    private String stupidText;

    @Override    
    public Boolean processSubmit() {
        return true;
    }

}
